package io.renren.modules.uploadfile.valueobject;

import io.netty.util.internal.StringUtil;

/**
 * @ClassName Message
 * @Description TODO
 * @Author 树下魅狐
 * @Date 2020/4/28 0028 19:21
 * @Version since 1.0
 **/
public class Message {
    private int code;
    private String url;
    private String msg;
    private String fileName;
    private int uploaded;

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public int getUploaded() {
        return uploaded;
    }

    public void setUploaded(int uploaded) {
        this.uploaded = uploaded;
    }

    public Message(String msg) {
        this.msg = msg;
    }
    public int getCode(){return code;}

    public void setCode(int code) { this.code = code; }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) { this.url = url; }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Message Ok(String url,String msg)
    {
        Message message = new Message(msg);
        message.setUrl(url);
        message.setCode(0);
        return message;
    }

    public static Message Fail(String msg)
    {
        Message message = new Message(msg);
        message.setCode(-1);
        return message;
    }

}
